package leecode

func findIndices(nums []int, indexDifference int, valueDifference int) []int {
	var result []int
	for i := 0; i < len(nums); i++ {
		for j := 0; j < len(nums); j++ {
			if abs2903(i-j) >= indexDifference && abs2903(nums[i]-nums[j]) >= valueDifference {
				result = append(result, i, j)
				break
			}
		}
	}
	if len(result) == 0 {
		return []int{-1, -1}
	}
	return result
}

func abs2903(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
